package com.chris.core.socket.netty.dto.protocol;

import java.io.Serializable;

/**
 * 命令类数据结构
 * @param <T>
 */
public class CmdObjectProtocol<T> implements Serializable {

    /**
     * 状态码 （int类型)
     */
    private int typemode;
    /**
     * 代码 msg , sendfile , revicefile
     */
    private String code;
    /**
     * 标识 ：可以层带uuid 或其他唯一标识
     */
    private String tag;
    /**
     * 信息载体
     */
    private String msg;
    /**
     * 数据数据
     */
    private T data;

    public CmdObjectProtocol(int typemode, String msg) {
        this.typemode = typemode;
        this.msg = msg;
    }

    public CmdObjectProtocol(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public CmdObjectProtocol(String code, String tag, String msg) {
        this.code = code;
        this.tag=tag;
        this.msg = msg;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getTypemode() {
        return typemode;
    }

    public void setTypemode(int typemode) {
        this.typemode = typemode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }
}
